<?
abstract class Singleton {
	private function __construct() {}
	private function __clone() {}
	
	protected static function getInstance($className) {
		static $instances = array();
	
		//$className = get_called_class();
		if (!isset($instances[$className])) {
			$instances[$className] = new $className();
		}
		
		return $instances[$className];
	}
}
?>
